]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
background: Handle errors when loading wallpapers
authorAlexander Mikhaylenko <alexm@gnome.org>
Sat, 12 Feb 2022 13:33:51 +0000 (18:33 +0500)
committerMarge Bot <marge-bot@gnome.org>
Sat, 12 Feb 2022 14:31:10 +0000 (14:31 +0000)
Since it happens while setting up the startup animation, we will get stuck
inside that animation and block input if it fails.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/5062

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2176>

js/ui/background.js

index 21359d0a83ca00e7a3a107a44855428b6abb4742..0b53f3fd0517886c10a7cb0cebe473de4a18c4ea 100644 (file)
@@ -496,11 +496,17 @@ var Background = GObject.registerClass({
     }
 
     async _loadFile(file) {
-        const info = await file.query_info_async(
-            Gio.FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
-            Gio.FileQueryInfoFlags.NONE,
-            0,
-            null);
+        let info;
+        try {
+            info = await file.query_info_async(
+                Gio.FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE,
+                Gio.FileQueryInfoFlags.NONE,
+                0,
+                null);
+        } catch (e) {
+            this._setLoaded();
+            return;
+        }
 
         const contentType = info.get_content_type();
         if (contentType === 'application/xml')